package com.ruoyi.comprehensive.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.comprehensive.mapper.SoldierRightsDeclareMapper;
import com.ruoyi.comprehensive.domain.SoldierRightsDeclare;
import com.ruoyi.comprehensive.service.ISoldierRightsDeclareService;

/**
 * 退役军人权益维护信息Service业务层处理
 *
 * @author jeffery
 * @date 2021-09-01
 */
@Service
public class SoldierRightsDeclareServiceImpl implements ISoldierRightsDeclareService {
    @Autowired
    private SoldierRightsDeclareMapper soldierRightsDeclareMapper;

    /**
     * 查询退役军人权益维护信息
     *
     * @param declareId
     *         退役军人权益维护信息主键
     *
     * @return 退役军人权益维护信息
     */
    @Override
    public SoldierRightsDeclare selectSoldierRightsDeclareByDeclareId(Long declareId) {
        return soldierRightsDeclareMapper.selectSoldierRightsDeclareByDeclareId(declareId);
    }

    /**
     * 查询退役军人权益维护信息列表
     *
     * @param soldierRightsDeclare
     *         退役军人权益维护信息
     *
     * @return 退役军人权益维护信息
     */
    @Override
    public List<SoldierRightsDeclare> selectSoldierRightsDeclareList(SoldierRightsDeclare soldierRightsDeclare) {
        return soldierRightsDeclareMapper.selectSoldierRightsDeclareList(soldierRightsDeclare);
    }

    /**
     * 新增退役军人权益维护信息
     *
     * @param soldierRightsDeclare
     *         退役军人权益维护信息
     *
     * @return 结果
     */
    @Override
    public int insertSoldierRightsDeclare(SoldierRightsDeclare soldierRightsDeclare) {
        soldierRightsDeclare.setCreateTime(DateUtils.getNowDate());
        return soldierRightsDeclareMapper.insertSoldierRightsDeclare(soldierRightsDeclare);
    }

    /**
     * 修改退役军人权益维护信息
     *
     * @param soldierRightsDeclare
     *         退役军人权益维护信息
     *
     * @return 结果
     */
    @Override
    public int updateSoldierRightsDeclare(SoldierRightsDeclare soldierRightsDeclare) {
        soldierRightsDeclare.setUpdateTime(DateUtils.getNowDate());
        return soldierRightsDeclareMapper.updateSoldierRightsDeclare(soldierRightsDeclare);
    }

    /**
     * 批量删除退役军人权益维护信息
     *
     * @param declareIds
     *         需要删除的退役军人权益维护信息主键
     *
     * @return 结果
     */
    @Override
    public int deleteSoldierRightsDeclareByDeclareIds(Long[] declareIds) {
        return soldierRightsDeclareMapper.deleteSoldierRightsDeclareByDeclareIds(declareIds);
    }

    /**
     * 删除退役军人权益维护信息信息
     *
     * @param declareId
     *         退役军人权益维护信息主键
     *
     * @return 结果
     */
    @Override
    public int deleteSoldierRightsDeclareByDeclareId(Long declareId) {
        return soldierRightsDeclareMapper.deleteSoldierRightsDeclareByDeclareId(declareId);
    }
}
